const msqlFile = require('../assets/js/commnMySQL');
const connection = msqlFile.sqlConnection;
module.exports = {
  validateEmailAndPassword(email,password,callback){
    let sql = `SELECT * FROM users WHERE email='${email}' AND \`password\`='${password}'`;
    connection.query(sql,(err,result)=>{
      callback(err,result[0]);
    });
  },
  getAllUsers(callback){
    let sql = `SELECT * FROM users`;
    connection.query(sql,(err,result)=>{
      callback(err,result);
    });
  },
  
};